<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<input type="" name="">
	<p style="color: red;"></p>
	<script type="text/javascript">
		let inp = document.querySelector('input')
		let p = document.querySelector('p')
		/*
			量词
			* 重复0次或者无数次
			+ 重复1次或多次
			？ 重复0次或一次
			{n} 重复n次
			{n,} 重复n次或n次以上
			{n,m} 重复n到m次

		*/

		//09456790045@qq.com
		let reg = /^\w{8,}@[0-9a-zA-Z]{2,}.com$/g

		inp.onblur = function() {
			console.log(this.value)
			let res = this.value.match(reg)
			console.log(res)
			if (res) {
				p.innerText = "格式正确"
			}else{
				p.innerText = "请输入正确的邮箱"
			}
		}

		//手机号 1(3-9) xxxxxxxxx
		let mo = /^1[3-9]\d{9}$/g
		let reg2 = /^\d{6}\d{2}[0-9]&/i
	</script>
</body>
</html>